﻿<!-- 
This resource dictionary is used by the MainWindow. 
-->
<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vm="clr-namespace:WpfFeeCalculator.ViewModel"
  xmlns:vw="clr-namespace:WpfFeeCalculator.View"
    
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:MVVM_ViewModel="clr-namespace:WpfFeeCalculator.Locator" 
        mc:Ignorable="d"
  >


    



    <DataTemplate DataType="{x:Type vm:CalculationViewModel}">
            <vw:CalculationView  />
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:MoreFeesViewModel}">
        <vw:MoreFeesView  />
    </DataTemplate>
    <MVVM_ViewModel:MainViewModelLocator x:Key="MainViewModelLocatorDataSource" d:IsDataSource="True"/>
    <!-- 
  This style configures both of the main content areas in the main window.
  -->

    <DataTemplate x:Key="titleText">
        <TextBlock Text="{Binding}" 
             Foreground="Green" 
             FontSize="16" 
             FontWeight="Normal"
             FontStyle="Italic" 
             TextWrapping="Wrap"/>
    </DataTemplate>

    <Style x:Key="MainHCCStyle" TargetType="{x:Type HeaderedContentControl}">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Border 
            BorderBrush="LightGray" 
            BorderThickness="5" 
            CornerRadius="5" 
            Margin="4" 
            Padding="4" 
            SnapsToDevicePixels="True" 
            >
                       
                        <TextBlock 
              FontSize="14"
              FontWeight="Bold"
              Foreground="White" 
              
              Text="{TemplateBinding Content}" 
              />
                       
                    </Border>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <!-- 
        This template ensures that content of a HeaderedContentControl 
        fills the available vertical space. 
        -->
                <ControlTemplate TargetType="{x:Type HeaderedContentControl}">
                    <DockPanel>
                        <ContentPresenter 
              DockPanel.Dock="Top"
              ContentSource="Header" 
              
              ContentTemplate="{TemplateBinding HeaderTemplate}" 
              />
                        <ContentPresenter 
              ContentSource="Content" 
              ContentTemplate="{TemplateBinding ContentTemplate}" 
              />
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--
  This style ensures that the borders in the main window are consistent.
  -->
    <Style x:Key="MainBorderStyle" TargetType="{x:Type Border}">
        <Setter Property="Background" Value="WhiteSmoke" />
        <Setter Property="BorderBrush" Value="LightGray" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="CornerRadius" Value="5" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
    </Style>

    <!--
  This template explains how to render the list of commands on the left
  side in the main window (the 'Control Panel' area).
  -->
    <DataTemplate x:Key="CommandsTemplate">
        <ItemsControl IsTabStop="False" ItemsSource="{Binding}" Margin="6,2">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <TextBlock Margin="2,6">
            <Hyperlink Command="{Binding Path=Command}">
              <TextBlock Text="{Binding Path=DisplayName}" />
            </Hyperlink>
          </TextBlock>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>

    <!-- 
  This template explains how to render 
  a tab item with a close button.
  -->
    <DataTemplate x:Key="ClosableTabItemTemplate">
        
            <DockPanel Width="120">
                <Button 
        Command="{Binding Path=CloseCommand}"
        Content="X"
        Cursor="Hand"
        DockPanel.Dock="Right"
        Focusable="False"
        FontFamily="Courier" 
        FontSize="9"
        FontWeight="Bold"  
        Margin="0,1,0,0"
        Padding="0"
        VerticalContentAlignment="Stretch"
                HorizontalContentAlignment="Stretch"
                HorizontalAlignment="Stretch"
        Width="16" Height="16" 
        />
                <ContentPresenter 
        Content="{Binding Path=DisplayName}" 
        
                    
        />
            </DockPanel>
        
    </DataTemplate>


</ResourceDictionary>